import request from "@/utils/request";
// 获取banner列表
// position 商品首页传3，默认首页传1
export function getBannerListApi(data) {
  return request({
    url: "/app-api/promotion/banner/list",
    method: "GET",
    data,
  });
}

// 获取当前秒杀活动商品列表
export function getNowActivityApi(data) {
  return request({
    url: "/app-api/promotion/seckill-activity/get-now",
    method: "GET",
    data,
  });
}
// 获取秒杀活动列表
export function getActivityPageApi(data) {
  return request({
    url: "/app-api/promotion/seckill-config/list",
    method: "GET",
    data,
  });
}
// 根据活动ID获取秒杀活动商品分页
export function getActivityShopsApi(data) {
  return request({
    url: "/app-api/promotion/seckill-activity/page",
    method: "GET",
    data,
  });
}
// 获取当前秒杀活动详情
export function getNowActivityDetailApi(data) {
  return request({
    url: "/app-api/promotion/seckill-activity/get-detail",
    method: "GET",
    data,
  });
}

// 获得商品分类列表-枚举
export function getCategoryListApi(data) {
  return request({
    url: "/app-api/product/category/list",
    method: "GET",
    data,
  });
}

// 获得商品列表 SPU 分页
export function getSpuListApi(data) {
  return request({
    url: "/app-api/product/spu/page",
    method: "GET",
    data,
  });
}

// 获得商品列表 SPU 明细
export function getSpuDetailApi(data) {
  return request({
    url: "/app-api/product/spu/get-detail",
    method: "GET",
    data,
  });
}

// 获得商品基础规则配置
export function getBasicRulesApi(data) {
  return request({
    url: "/app-api/promotion/basic-setting/get",
    method: "GET",
    data,
  });
}

// 获取商品评价列表
export function getEvaluateListApi(data) {
  return request({
    url: "/app-api/product/comment/page",
    method: "GET",
    data,
  });
}

// 获得订单结算信息
export function settlementApi(data) {
  return request({
    url: "/app-api/trade/order/settlement",
    method: "GET",
    data,
  });
}
// 查询用户的购物车列表
export function getCardListApi(data) {
  return request({
    url: "/app-api/trade/cart/list",
    method: "GET",
    data,
  });
}
// 添加商品到购物车
export function AddCardApi(data) {
  return request({
    url: "/app-api/trade/cart/add",
    method: "POST",
    data,
  });
}
// 删除购物车商品
export function removeCardApi(ids) {
  return request({
    url: "/app-api/trade/cart/delete?ids=" + ids.join(","),
    method: "DELETE",
    // data,
  });
}
